import * as zrender from 'zrender';
import { timeScaleHeight, personColumnWidth } from '../../config';
import { drawVerticalGridLines } from './vertical-grid';
import { drawHorizontalGridLines } from './horizontal-grid';
import { drawHorizontalLines } from './horizontal-lines';

export { drawHorizontalGridLines, drawHorizontalLines, drawVerticalGridLines };

/**
 * 绘制时间轴背景
 * @param {object} zr ZRender实例
 * @param {ChartState} chartState 图表状态对象
 */
export function drawTimeScaleBackground(zr: any, chartState: ChartState) {
  // 时间轴背景（从人员列右侧开始）
  const timeScale = new zrender.Rect({
    shape: {
      x: personColumnWidth,
      y: 0,
      width: chartState.canvasWidth - personColumnWidth,
      height: timeScaleHeight,
    },
    style: {
      fill: '#e8e8e8',
    },
    silent: true,
  });
  zr.add(timeScale);
}
